<?php
/**
 * Simple Light PHP Framework
 *
 * @copyright Marc PEPIN 2012
 * @author Marc PEPIN
 *
 */

defined('SLP_ROOT') or die("You've not access to this page");

/*
 * @file Bootstrap.php
 * @author Marc PEPIN
 * This file countain framework bootstrap
 */


/**
* Check if environment is correclty set
*/

switch (ENVIRONMENT)
{
	case 'development':
		error_reporting(E_ALL);
		ini_set('display_errors', '1');
	break;
	case 'production':
		error_reporting(0);
	break;
	default:
		exit('The application environment is not set .');
}


/**
* initiate framework
*/

require(SLP_ROOT.'/system/libraries/Slp.php');

/*
* load config class
*/

Slp::getInstance()->loadClass('Slp_Config');

Slp::getInstance()->loaded->Slp_Config->load('config');

Slp::getInstance()->loaded->Slp_Config->load('database');


/**
* load logger class
*/

Slp::getInstance()->loadClass('Slp_Logger');


/*
* load session class
*/

Slp::getInstance()->loadClass('Slp_Session');
	

/*
* load Common class
*/

Slp::getInstance()->loadClass('Slp_Common');


/**
* load Controller
*/

Slp::getInstance()->loadClass('Slp_Controller', NULL, false);


/*
* load path class
*/

Slp::getInstance()->loadClass('Slp_Path');


/*
* load databse class
*/

Slp::getInstance()->loadClass('Slp_Database');



?>